//
//  informationItem.m
//  SoundPill
//
//  Created by 宋鹏鹏 on 15/3/27.
//  Copyright (c) 2015年 宋旭东. All rights reserved.
//

#import "informationItem.h"
#define kDeviceHeight [UIScreen mainScreen].bounds.size.height
#define kDeviceWidth  [UIScreen mainScreen].bounds.size.width

#define kTitleScale 0.7
// 设置宽高
#define kinformationItemW kDeviceWidth*0.73
#define kinformationItemH 20

@implementation informationItem

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 1.文字颜色
        [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        self.titleLabel.textAlignment = NSTextAlignmentLeft;
        self.titleLabel.font = [UIFont systemFontOfSize:12.0f];
//        self.titleLabel.adjustsFontSizeToFitWidth = YES;
        
        //
        self.imageView.contentMode = UIViewContentModeScaleAspectFit;
        
    }
    return self;
}

- (void)setTitle:(NSString *)title
{
    _title = title;
    
    [self setTitle:title forState:UIControlStateNormal];
}

- (void)setFrame:(CGRect)frame
{
    frame.size = CGSizeMake(kinformationItemW, kinformationItemH);
    [super setFrame:frame];
}

- (CGRect)titleRectForContentRect:(CGRect)contentRect
{
    CGFloat h = 20;
    CGFloat w = contentRect.size.width;
    return CGRectMake(0, 0, w, h);
}

- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
    return CGRectMake(0, 0, 20, 20);
}

@end
